<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org"
	xmlns:dt="http://github.com/dandelion/datatables"
	xmlns:sec="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<title th:utext="#{title.newusecase}"></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="Dhrubo" />

<!-- Le styles -->
<link rel="stylesheet" type="text/css" media="all"
	href="css/bootstrap.css" th:href="@{/resources/css/bootstrap.css}" />
<style type="text/css">
body {
	padding-top: 60px;
	padding-bottom: 40px;
}

.sidebar-nav {
	padding: 9px 0;
}

@media ( max-width : 980px) {
	/* Enable use of floated navbar text */
	.navbar-text.pull-right {
		float: none;
		padding-left: 5px;
		padding-right: 5px;
	}
}
</style>
<link rel="stylesheet" type="text/css" media="all"
	href="css/bootstrap-responsive.css"
	th:href="@{/resources/css/bootstrap-responsive.css}" />


</head>

<body>

	<div th:substituteby="fragments/userheader :: navbar"> </div>

	<div class="container-fluid">
	
		<div class="row-fluid">
			<div class="span6">
				<ul class="breadcrumb">
					<li><a href="home" th:utext="#{home}"></a> <span class="divider">/</span></li>

					<li class="active" th:utext="#{newusecase}"></li>
				</ul>
			</div>
			<div class="span6">
				<div class="btn-group pull-right">
					<a class="btn btn-primary" href="listusecases" th:utext="#{listusecases}"></a> 
					
				</div>
			</div>
		</div>
	
	
	
		<div class="row-fluid">

			<div class="span12">

				<form th:action="@{/saveusecase}"
					class="form-horizontal" id="newusecaseform" th:object="${useCase}"
					method="post">

					<fieldset>

						<legend th:utext="#{newusecase}"></legend>
						
						<div class="alert" th:if="${noproject}">
    						<button type="button" class="close" data-dismiss="alert">&times;</button>
    							<strong>Warning!</strong> <span th:utext="#{noprojectwarning}"></span>
    					</div>

						<div id="message">
						
						</div>

						<div class="control-group">
							<label class="control-label" for="name" th:utext="#{usecasename}"></label>
							<div class="controls">
								<input type="text" th:field="*{name}" class="input-xlarge"
									th:placeholder="#{usecasename}" required="required" />
							</div>
						</div>




						<div class="control-group">
							<label class="control-label" for="name" th:utext="#{description}"></label>
							<div class="controls">

								<textarea rows="3" cols="20" th:field="*{description}"
									class="input-xlarge" th:placeholder="#{description}"></textarea>
							</div>
						</div>

						<div class="control-group">
							<label class="control-label" for="name" th:utext="#{selectproject}"></label>
							<div class="controls">

								<select name="project.id" >
									<option th:each="p : ${projects}" th:label="${p.name}" 
										th:value="${p.id}" th:text="${p.name}" />

								</select>

							</div>
						</div>



						<div class="form-actions">
							<button type="submit" class="btn btn-success" th:text="#{save}" th:unless="${noproject}"></button>
							<button type="reset" class="btn btn-info" th:text="#{cancel}" th:unless="${noproject}"></button>
							
							<a href="newproject" class="btn btn-primary pull-right" th:if="${noproject}">New Project</a>
						</div>

					</fieldset>
				</form>


			</div>
			<!--/span-->
		</div>
		<!--/row-->

		<hr />



	</div>
	<!--/.fluid-container-->

	<div th:substituteby="fragments/userheader :: footer"> </div>

	<!-- Le javascript
    ================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->

	<script src="js/jquery.js" th:src="@{/resources/js/jquery.js}"></script>

	<script src="js/bootstrap-dropdown.js"
		th:src="@{/resources/js/bootstrap-dropdown.js}"></script>

	<script src="js/bootstrap-alert.js"
		th:src="@{/resources/js/bootstrap-alert.js}"></script>

	<script src="js/newusecase.js" th:src="@{/resources/js/newusecase.js}"></script>
</body>
</html>
